package Function;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Vector;

public class FCLanguageLibrary {
	private String strUrl = "./language/ch.vw";
	private Vector<String> chId = new Vector<>();
	private Vector<String> chName = new Vector<>();

	public FCLanguageLibrary() {
		try {
			BufferedReader re = new BufferedReader(new InputStreamReader(new FileInputStream(strUrl), "UTF-8"));
			String a = re.readLine();
			while (a != null) {
				chId.add(a.split("=")[0]);
				chName.add(a.split("=")[1]);
				a = re.readLine();
			}
			re.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public String getNameOfId(String id) {
		try {
			return chName.get(chId.indexOf(id));
		} catch (Exception e) {
			return id;
		}
	}
}
